package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import top.zywork.dao.DataDictAndItemDAO;
import top.zywork.dos.DataDictAndItemDO;
import top.zywork.dto.DataDictAndItemDTO;
import top.zywork.dto.PagerDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.DataDictAndItemService;

import javax.annotation.PostConstruct;

/**
 * DataDictAndItemServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-11-29<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "dataDictAndItemService")
public class DataDictAndItemServiceImpl extends AbstractBaseService implements DataDictAndItemService {

    private DataDictAndItemDAO dataDictAndItemDAO;

    @Override
    @Cacheable(value = "data_dict_and_item", key = "#queryObj.dataDictDictCode", unless="#result == null")
    public PagerDTO listAllByCondition(Object queryObj) {
        return super.listAllByCondition(queryObj);
    }

    @Autowired
    public void setDataDictAndItemDAO(DataDictAndItemDAO dataDictAndItemDAO) {
        super.setBaseDAO(dataDictAndItemDAO);
        this.dataDictAndItemDAO = dataDictAndItemDAO;
    }

    @PostConstruct
    public void init() {
        super.init(DataDictAndItemDO.class, DataDictAndItemDTO.class);
    }
}
